﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Entitys.CommonLogs;

namespace Common.Entitys
{
    /// <summary>
    /// 日志的实体(解决如何存)
    /// </summary>
   [Serializable]
    public abstract class LogEntity
    {
        public DateTime LogTime=DateTime.Now;

        public string Content;

        /// <summary>
        /// 日志文件路径
        /// </summary>
        /// <returns></returns>
        public virtual List<string> GetLogFiledPath()
        {
            List<string> lisPaths = new List<string>();
           // lisPaths.Add(this.GetType().GUID.ToString("N"));
            return lisPaths;
        }

        /// <summary>
        /// 日志文件名称
        /// </summary>
        /// <returns></returns>
        public virtual string GetLogFiledName()
        {
            return $"{this.GetType().Name}.txt";
        }

        public new virtual string ToString()
        {
            return $"{{ {LogTime.ToString("yyyyMMdd HH: mm:ss: fff")}   {Content}}} \r\n";
        }
    }


}
